{% extends "wiki/base.html" %}

{% load i18n %}
{% load wiki %}
{% load wikiurl %}
{% load extra_tagging_tags %}


{% block head_title %}Wiki for {{ group.name }} {% endblock %}

{% block body %}

    {% if allow_write or article.id %}
    <div class="right_panel">
        <div class="tribes">
            <h2>{% trans "Actions" %}</h2>
            {% if article.id %}

            {% if allow_write %}<li><a href="{% wikiurl edit group article %}">{% trans "Edit this article" %}</a> </li>
            {% endif %}
            <li><a href="{% wikiurl article_history group article %}">{% trans "Editing history" %}</a> </li>

            {% else %}

            <li><a href="{% wikiurl edit group article %}">{% trans "Create this article" %}</a></li>

            {% endif %}
        </div>
    </div>
    {% endif %}

    {% wiki_title group %}

    <h2><a href="{% wikiurl article group article %}" rel="bookmark">{{ article.title }}</a></h2>

    {% if not article.id and allow_write %}
        <p>
            {% trans "This article does not exist." %}
            <a href="{% wikiurl edit group article %}" {% trans ">Create it now</a>?" %}
        </p>
    {% endif %}

    {% render_content article %}

    {% show_tags_for article %}

    {% if article.id and can_observe %}
        {% if is_observing %}
            <form action="{% wikiurl stop_observing group article %}" method="post">
                <input type="submit" value="Stop Observing Article">
            </form>
        {% else %}
            <form action="{% wikiurl observe group article %}" method="post">
                <input type="submit" value="Observe Article">
            </form>
        {% endif %}
    {% endif %}
{% endblock %}
